function odata=gcpick_filtwave(idata, option, config)
odata = idata;
switch option{1}
    case {'l', 'lp', 'low', 'lowpass'}
        type = 'low';
    case {'h', 'hp', 'high', 'highpass'}
        type = 'high';
    case {'bs', 'stop', 'bandstop'}
        type = 'stop';
    case {'bp', 'p', 'pass', 'bandpass'}
        type = 'bandpass';
    otherwise
        type = 'bandpass';
end
freq = [];
order = config.filterOrder;
for i=2:length(option)
    freq = [freq, str2double(option(i))];
end
delta = 0;
for i = 1:length(odata)
    if odata(i).delta ~= delta
        delta = odata(i).delta;
        [b,a]=butter(order, freq*2*odata(i).delta, type);
    end
    odata(i).E = filtfilt(b, a, odata(i).E);
    odata(i).N = filtfilt(b, a, odata(i).N);
    odata(i).Z = filtfilt(b, a, odata(i).Z);
end
end